# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=parampampam
pkgver=45.9171018
pkgrel=6
pkgdesc='This tool for brute discover GET and POST parameters.'
groups=('blackarch' 'blackarch-webapp' 'blackarch-fuzzer')
arch=('any')
url='https://github.com/Bo0oM/ParamPamPam'
license=('custom:unknown')
depends=('python' 'python-beautifulsoup4' 'python-esprima' 'python-fuzzywuzzy'
         'python-html5lib' 'python-requests' 'python-urllib3'
         'python-levenshtein')
makedepends=('git')
source=("$pkgname::git+https://github.com/Bo0oM/ParamPamPam.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i '1i\#!/usr/bin/python3' parampp.py
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 755 parampp.py "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md

  rm README.md requirements.txt

  cp -a * "$pkgdir/usr/share/$pkgname/"
}

